package fun.werfamily.wf.goods.core.api;

import fun.werfamily.wf.base.annotation.MustLogin;
import fun.werfamily.wf.base.vo.Result;
import fun.werfamily.wf.goods.core.domain.dto.response.GoodsCategoryDTO;
import fun.werfamily.wf.goods.core.domain.service.GoodsCategoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: Mr.WenMing Zhang
 * @Date: 2023-05-02 16:41
 * @Description:
 */
@Api(tags = "商品模块")
@RequestMapping("/open/goods/category")
@RestController
@Slf4j
public class GoodsCategoryController {

    @Resource
    private GoodsCategoryService goodsCategoryService;

    @ApiOperation("商品分类列表")
    @GetMapping("/list")
    @MustLogin(value = false)
    public Result<List<GoodsCategoryDTO>> listGoodsCategory(){
        return Result.success(goodsCategoryService.listGoodsCategory());
    }
}
